home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / comm / yep16.zip / YEPU.ZIP / YEPUHTML.CMD < prev    next >
OS/2 REXX Batch file  |  1996-09-29  |  1KB  |  49 lines

  1. /* YEPuHTML.CMD -- Converts a YEP URL log file to a simple HTML document.
  2.  
  3.  - use standard redirection to write HTML file. I.E. Yepuhtml >my-new.html
  4.  - please edit the line below to reflect the path/filename of your Log,
  5.    or specify filename on command line. I.E. Yepuhtml url.log >my-new.html
  6.  
  7. */
  8. UrlLog = 'd:\tm\url.log'
  9.  
  10. BetweenRecords = 1;
  11.  
  12. Parse arg ln
  13. if (ln \= '') then UrlLog = ln
  14.  
  15. ret = stream(UrlLog,'c','open read')
  16. if ret <> 'READY:' then do
  17.     ret=lineout('STDERR','Can not open URL Log "'UrlLog'" to read.');
  18.     exit
  19. end
  20.  
  21. say '<HTML><HEAD>'
  22. say '<TITLE>Yep URL Log to HTML conversion 'date('N')', 'time('C')'</title>'
  23. say '</HEAD>'
  24. say '<BODY>'
  25. say '<a name="TheBegin">J</a>ump to the <a href="#TheEnd">bottom</a> of the list.'
  26. say '<ol>'
  27.  
  28. do while lines(UrlLog)<>0
  29.     ln = linein(UrlLog)
  30.     
  31.     if (ln \= '') & (BetweenRecords = 1) then do
  32.         say '<br><li>'
  33.         BetweenRecords = 0;
  34.     end
  35.  
  36.     parse var ln what it_is
  37.     select 
  38.         when what == '' then BetweenRecords = 1
  39.         when what == 'URL:' then say what'  <a href="'it_is'">'it_is'</a><br>'
  40.         when what == 'Subject:' then say what'  <strong>'it_is'</strong><br>'
  41.         otherwise say what'  'it_is'<br>'
  42.     end
  43. end
  44.  
  45. say '</ol>'
  46. say '<a name="TheEnd">J</a>ump to the <a href="#TheBegin">top</a> of the list.'
  47. say '</BODY>'
  48. say '</HTML>'
  49.